<%@ page language="java" pageEncoding="utf-8"%>
<%@ page language="java" import="java.util.*"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

	 double perMaxSize = 100;//单个文件允许的max大小
    String sizeUnit = "MB";//perMaxSize数据对应的单位
    String ext = "*.jpg;*.jpeg;*.gif";//允许上传的文件类型
    //文件上传提交的目标页面
	StringBuffer uploadUrl = new StringBuffer("http://");
	uploadUrl.append(request.getHeader("Host"));
	uploadUrl.append(request.getContextPath());
	uploadUrl.append("/file/uploadfiles.action");

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
	
<title>国际研究生教育法律法规信息资料数据库</title>
<link href="css/userfile.css" type="text/css" rel="stylesheet" />
<link href="css/base.css" type="text/css" rel="stylesheet" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/handlers_me.js"></script>
<script type="text/javascript" src="js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="js/secloud.js"></script>

<script type="text/javascript">
var swfu;
var uploadReslut = {
	"error_1":"<s:text name='error_1'/>",
	"error_2":"<s:text name='error_2'/>",
	"error_3":"<s:text name='error_3'/>",
	"error_4":"<s:text name='error_4'/>",
	"error_5":"<s:text name='error_5'/>",
	"error_6":"<s:text name='error_6'/>",
	"error_7":"<s:text name='error_7'/>",
	"success":"<s:text name='uploadSuccess'/>",
	"fail":"<s:text name='uploadFail'/>",
	
};


SWFUpload.onload = function () {
	var settings = {
		flash_url : "js/swfupload.swf",
		upload_url: "<%=uploadUrl%>",
		post_params: {
			"user_id" : "<s:property value='#session.username'/>",
		},
		file_size_limit : "100 MB",
		file_types : "*.*",
		file_types_description : "ALL Files",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel",
			uploadButtonId : "btnUpload",
			myFileListTarget : "idFileList"
		},
		debug: false,
		auto_upload:false,

		// Button Settings
		button_image_url : "images/XPButtonUploadText_61x22.png",	// Relative to the SWF file
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 61,
		button_height: 22,

		// The event handler functions are defined in handlers.js
		swfupload_loaded_handler : swfUploadLoaded,
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete,	// Queue plugin event
		
		// SWFObject settings
		minimum_flash_version : "9.0.28",
		swfupload_pre_load_handler : swfUploadPreLoad,
		swfupload_load_failed_handler : swfUploadLoadFailed
	};

	swfu = new SWFUpload(settings);
	}
	 
	 
	 


</script>
</head>



<body>

  <s:include value="../user_page_top.jsp"/>
  
  <div style="height:20px;"></div>
<div class = "usercont">
  	
    <s:include value="../user_page_left.jsp"/>
   
    <div class="width-800 right">
		
         
            
        
        
        <div class="righttcont">
        	<h2>批量上传</h2>
        	<table width="100%" cellspacing="4" cellpadding="4" border="0" bgcolor="#FCFCFC">
	<tr> 
	<td class="DH1">
	<table width="100%" cellspacing="4" cellpadding="4" border="0" bgcolor="#FCFCFC">
	<tr>
	<td class="DH2">
	<strong>批量上传文件 （单个文件最大不能超过：<%=perMaxSize%> <%=sizeUnit%>） </strong> 
	</td><td class="DH2" align="right"></td>
	</tr>
	</table>
<div id="content">
	
	<input id="id_time_remain" name="time_remain" type="hidden" value="1"/>
	<input id="id_file_use_id" name="file_use_id" type="hidden" value="1"/>
	<form id="form1" action="file/uploadfiles.action" method="post" enctype="multipart/form-data">
		
		<table width="90%" cellspacing="0" cellpadding="0" border="0">
		
		<tr><td>
		<span id="spanButtonPlaceholder"></span>
		<input id="btnUpload" type="button" value="上传文件" class="btn" />
		<input id="btnCancel" type="button" value="取消全部上传" disabled="disabled" class="btn" /></td>
		</tr></table>
		<table id="idFileList" class="uploadFileList">
		<tr class="uploadTitle">
			<td><b>文件名</b></td><td width=100px><b>文件大小</b></td>
			<td width=150px><b>状态</b></td>
			<td width=35px>&nbsp;</td></tr>
		</table>
		等待上传 <span id="idFileListCount">0</span> 个 ，成功上传 <span id="idFileListSuccessUploadCount">0</span> 个
		<div id="divSWFUploadUI" style="visibility: hidden;"></div>
		<noscript style="display: block; margin: 10px 25px; padding: 10px 15px;">
			很抱歉，相片上传界面无法载入，请将浏览器设置成支持JavaScript。
		</noscript>
		<div id="divLoadingContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			相片上传界面正在载入，请稍后...
		</div>
		<div id="divLongLoading" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			相片上传界面载入失败，请确保浏览器已经开启对JavaScript的支持，并且已经安装可以工作的Flash插件版本。
		</div>
		<div id="divAlternateContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			很抱歉，相片上传界面无法载入，请安装或者升级您的Flash插件。
			请访问： <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">Adobe网站</a> 获取最新的Flash插件。
		</div>
	</form>
</div>
</td></tr></table>
        </div>
		<div style="height:20px;"></div>
		
		<div class="righttcont">
            <h2>单文件上传</h2>
                 
            <s:form enctype="multipart/form-data"  action="uploadfiletype1" namespace="/file" method="post">
            	<input type="hidden" name="file_num" id="id_file_num" value="2"/>
            	<s:fielderror></s:fielderror>
            	<s:if test="up_success=='true'"><span style="color:red">上传成功</span></s:if>
            	<s:if test="up_success=='false'"><span style="color:red">上传失败：<s:property value="up_fail_message"/></span></s:if>
            	<table>
       					
					<tr>
						<th><label><s:text name="_prdirectory"/></label></th>
						<td><input name="content_file" type="file" /></td>
					</tr>
					<tr>
						<th><label><s:text name="_prfiles"/></label></th>
						<td><input name="files" type="file"/>
						<input type="hidden" name="file_id_list" id="id_file_id_list" value="file_res_0"/>
						</td>
						
						<td id="file_res_0"></td>
					</tr>
					
					<tr id ="tr_sumbit_id">
					  	<td><!--  <input name="" type="button" onclick="morefilex()" value="更多文件"></input>--></td>
					  <td><button name="" type="submit" ><s:text name="_prsubmit"/></button></td>
					</tr>
				</table>
            </s:form>
         </div>
         
	</div>
</div>   
     
     <s:include value="../foot.jsp"/>
     
</body>

</html>
